const { defineConfig } = require("@vue/cli-service");
module.exports = defineConfig({
  transpileDependencies: true,
  configureWebpack: {
    resolve: {
      alias: {
        "@assets": "@/assets",
        "@components": "@/components",
        "@pages": "@/pages",
        "@utils": "@/utils",
        "@api": "@/api",
      },
    },
  },
  devServer: {
    proxy: {
      "/api": {
        target: "http://gmall-h5-api.atguigu.cn/",
        ws: true,
        changeOrigin: true, // 伪装
        pathRewrite: {
          "^/api": "",  // 去除前缀
        }
      }
    }
  }
});
